<?php

class YouNet_Controller_Router_Route extends Zend_Controller_Router_Route
{
	private $_hasUpdateWildcat = false;
    public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
	{
		if( !$this->_hasUpdateWildcat )
		{
			$this->_updateWildcardData();
			$this->_hasUpdateWildcat = true;
		}
		return parent::assemble($data, $reset, $encode, $partial);
	}
	protected function _updateWildcardData()
	{
		if( isset($_POST['signed_request']) && Zend_Registry::isRegistered('app_data') )
		{
			$app_data = Zend_Registry::get('app_data');
			foreach($app_data as $key => $value)
			{
				$this->_wildcardData[$key] = $value;
			}
		}
	}
}
